/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trechatserver;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.Socket;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author SKL
 */
public class listener extends Thread{
    private static Socket serv;
    private static String line="";
    
    public listener(Socket client)
    {
        serv = client;
        Scanner in = null;
        
        try {
            in = new Scanner(serv.getInputStream());
        } catch (IOException ex) {
            Logger.getLogger(listener.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        while (in.hasNextLine()){
        line = in.nextLine();
        System.out.println(line);
        }
    } 
}
